/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */


var fromPointTypeCombo = {
    xtype: 'combo',
    width: 125,
    store: pointTypeStore,
    id: 'FromPointTypeCombo',
    displayField: 'name',
    valueField: 'id',
    hiddenName: 'pointTypeId',
    mode: 'remote',
    forceSelection: true,
    triggerAction: 'all',
    fieldLabel: '监测点类型',
    emptyText: '监测点类型...',
    selectOnFocus: true,
    listeners: {
        select: function(combo, record, index) {
            storeFromPoint.baseParams.pointTypeId = combo.getValue();
        }
    }
};

var fromPointType2Combo = {
    xtype: 'combo',
    width: 125,
    store: pointType2Store,
    id: 'FromPointType2Combo',
    displayField: 'name',
    valueField: 'id',
    hiddenName: 'pointType2Id',
    mode: 'remote',
    forceSelection: true,
    triggerAction: 'all',
    fieldLabel: '城农网类别',
    emptyText: '城农网类别...',
    selectOnFocus: true,
    listeners: {
        select: function(combo, record, index) {
            storeFromPoint.baseParams.pointType2Id = combo.getValue();
        }
    }
};

var fromVoltageLevelCombo = {
    xtype: 'combo',
    width: 125,
    store: voltageLevelStore,
    id: 'FromVoltageLevelCombo2',
    displayField: 'name',
    valueField: 'id',
    hiddenName: 'voltageLevelId',
    mode: 'remote',
    forceSelection: true,
    triggerAction: 'all',
    fieldLabel: '电压等级',
    emptyText: '电压等级...',
    selectOnFocus: true,
    listeners: {
        select: function(combo, record, index) {
            storeFromPoint.baseParams.voltageLevelId = combo.getValue();
        }
    }
};


var fromPointText = {
    xtype: 'textfield',
    name: 'pointName',
    emptyText: '输入监测点名称',
    id: 'FromPointName',
    listeners: {
        change: function(c, newValue, oldValue) {
            storeFromPoint.baseParams.name = newValue;
        }
    }
};

var fromSearchButton = {
    xtype: 'button',
    text: '搜索',
    iconCls: 'icon-search',
    width: 60,
    style: {marginLeft: '20px'},
    handler: function() {
        storeFromPoint.load({params: {start: 0, limit: _pageSize}});
    }
};

var tbarFromPoint = new Ext.Toolbar({
    items: [
        fromPointTypeCombo, fromPointType2Combo, fromVoltageLevelCombo, fromPointText, fromSearchButton
    ]
});


